<template>
	<view class="page user">
		<!-- <view class="flex items-center pxp" style="height: 200rpx;gap: 20rpx;padding-top: 200rpx;">
			<image src="../../static/logo.png" class="logo" mode=""></image>
			<view class="flex-1 text-white">
				<view class="" style="font-size: 16px;margin-bottom: 20rpx;">
					{{user_name}}
				</view>
			</view>
		</view>
		
		<view class="list">
			<view class="item">
				签订租赁协议
			</view>
			<view class="item" @click="logOut">
				退出登录
			</view>
		</view> -->
		<view class="newone">
			<image src="../../static/logo.png" class="nlogo" mode=""></image>
			<view class="" style="font-size: 18px;margin-left: 30rpx;">
				{{user_name}}
			</view>
		</view>
		<view class="nlist">
			<view class="nitem">
				<text class="xname">签订租赁协议</text>
				<wd-icon class="ctu" name="arrow-right"  color="#666" />
			</view>
			<view class="nitem" @click="logOut">
				<text class="xname">退出登录</text>
				<wd-icon class="ctu" name="arrow-right"  color="#666" />
			</view>
		</view>
		
		<wd-message-box />
	</view>
</template>

<script setup >
	import { ref } from 'vue';
	import { useMessage } from '@/uni_modules/wot-design-uni'
	const message = useMessage()
	
	const user_name = ref(uni.getStorageSync("username"))
	
	const logOut = () =>{
		 message
		    .confirm({
		      msg: '确定退出登录吗',
		      title: '退出登录'
		    })
		    .then(() => {
				uni.setStorageSync("token", null)
				uni.setStorageSync("etoken", null)
				uni.setStorageSync("userId", null)
				uni.reLaunch({
					url: "/pages/auth/index"
				})
		    })
		    .catch(() => {
		      console.log('点击了取消按钮')
		    })
	
	
	}
	
</script>
<style lang="scss">
	.user{
		background: #F7F8FC !important;
		height: 100vh;
		
		.logo{
			width: 160rpx;
			height: 160rpx;
			border-radius: 50%;
		}
		
		.text-white{
			color: #fff;
		}
	}
	
	.list{

		background-color: #eee;
		height: calc(100vh - 400rpx);
		border-radius: 50rpx 50rpx 0 0 ;
		padding: 50rpx;
		.item{
			background-color: #fff;
			margin-bottom: 40rpx;
			font-size: 14px;
			padding: 20rpx;
			color: #666;
		}
	}
	.newone{
		background-color: #fff;
		border-radius: 20rpx;
		padding:40rpx 30rpx;
		margin: 30rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		.nlogo{
			border-radius: 50%;
			width: 120rpx;
			height: 120rpx;
		}
	}
	.nlist{
		background-color: #fff;
		border-radius: 20rpx;
		padding:10rpx 20rpx;
		margin: 30rpx;
		display: flex;
		flex-direction: column;
		.nitem{
			display: flex;
			padding: 25rpx 10rpx;
			flex-direction: row;
			align-items: center;
			border-bottom: 1rpx solid #eee;
			justify-content: space-between;
			.xname{
				color: #333;
				font-weight: 500;
				font-size: 30rpx;
			}
			.ctu{
				margin-left: auto;
			}
		}
		.nitem:last-child{
			border-bottom: none;
		}
	}
</style>